/**
 * class extends super
 * author:dengyiping
 * date:2016/07/28
 */

//通过class关键字声明类
class Animal{
    constructor(){
        this.type = 'animal'
    }
    says(worlds){
        console.log(this.type + ' says: ' + worlds )
    }
}

let animal = new Animal();
animal.says('hello');

//通过extends实现继承
class Cat extends Animal{
    constructor(){
        super();//通过super来调用父类的实现
        this.type = 'cat'
    }
}
let cat = new Cat();  
cat.says('hello');